<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>.: cPanel - Questions :.</title>
	<?php $this->import()?>
	<script type="text/javascript">
		function confirmDelete(name) {
			return confirm("Are you sure you want to delete Question [" + name + "]?");
		}
	</script>
</head>
<body>
	<?php $this->header()?><br/>
		<table width="100%"><tr>
			<td align="left" width="50%"><a href="?c=cpanel&a=cats">Category [<?php echo $cat->name;?>]</a> > <a href="?c=cpanel&a=secs&cid=<?php echo $cat->id;?>">Section [<?php echo $sec->name;?>]</a></td>
			<td align="right" width="50%"><a href="?c=cpanel&a=quenew&sid=<?php echo $sec->id;?>">Create new Question</a></td>
		</tr></table>
		<hr/>
		<center>
			<table class="grid" cellspacing="1" cellpadding="5">
				<tr>
					<th align="center">Order</th>
					<th align="center" width="576">Content</th>
					<th align="center">Edit</th>
					<th align="center">Delete</th>
				</tr>
				<?php if ($ques->size == 0) {?>
					<tr><td colspan="4">There is not any question.</td></tr>
				<?php } else { foreach ($ques->list as $que) {?>
					<tr>
						<td align="center"><?php echo $que->order;?></td>
						<td align="left"><?php echo String::wrap($que->content);?></td>
						<td align="center"><a href="?c=cpanel&a=queedit&sid=<?php echo $sid;?>&id=<?php echo $que->id;?>">Edit</a></td>
						<td align="center"><a href="?c=cpanel&a=quedel&sid=<?php echo $sid;?>&id=<?php echo $que->id;?>" onclick="return confirmDelete('<?php echo $que->order;?>')">Delete</a></td>
					</tr>
				<?php } }?>
				<tr><td colspan="4" align="right" class="paging">
					<?php for ($i = 1; $i <= $ques->pages; $i++) {?>
						<?php if ($i == $page) {?> 
							<a class="chosen">[ <?php echo $i?> ]</a>
						<?php } else {?>  
							<a href="?c=cpanel&a=ques&sid=<?php echo $sid;?>&page=<?php echo $i;?>">[ <?php echo $i?> ]</a>
						<?php } ?>
					<?php } ?>
				</td></tr>
			</table>
		</center>
		<br/>
	<?php $this->footer()?>
</body>
</html>